package org.ourguy.mymoviesandshows;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;

public class AboutActivity extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.about);
	}
	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		MenuInflater inflater = getMenuInflater();
		inflater.inflate(R.menu.main_menu, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// Handle item selection
		switch (item.getItemId()) {
		case R.id.menuTrackingList: {
			Intent intent = new Intent().setClass(getApplicationContext(),
					MyMoviesAndShowsActivity.class);
			intent.putExtra("tab", 0);
			this.startActivity(intent);
			return true;
		}
		case R.id.menuSchedule: {
			Intent intent = new Intent().setClass(getApplicationContext(),
					MyMoviesAndShowsActivity.class);
			intent.putExtra("tab", 2);
			this.startActivity(intent);
			return true;
		}
		case R.id.menuAbout: {
			Intent intent = new Intent().setClass(getApplicationContext(),
					AboutActivity.class);
			this.startActivity(intent);
			return true;
		}
		case R.id.menuSearch: {
			Intent intent = new Intent().setClass(getApplicationContext(),
					SearchActivity.class);
			this.startActivity(intent);
			return true;
		}
		default:
			return super.onOptionsItemSelected(item);
		}
	}
}
